<%--
  Created by IntelliJ IDEA.
  User: wuxing
  Date: 2020/7/22
  Time: 11:10
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <script src="../js/jquery.js"></script>
    <script>
        $(function () {
            $("#password").blur(function () {
                $.ajax({
                    url: "/demo2/checkNameAndPass",
                    data: {"name": $("#name").val(), "pass": $("#password").val()},
                    datatype: 'json',
                    type: 'post',
                    success: function (data) {
                        $("#message").html(data);
                    },
                })
            });
        })
    </script>
</head>
<body>
<form action="/demo2/success.jsp">

    用户名:<input type="text" id="name" name="name">
    <br>
    密&nbsp;&nbsp;&nbsp;&nbsp;码:<input type="password" id="password" name="password">
    <span id="message"></span><br>
    <button type="submit" id="but">登陆</button>
</form>
</body>
</html>
